<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>发表主题</title>
<link rel="stylesheet" href="bootstrap-3.0.3/css/bootstrap.min.css">
<script src="js/jquery-2.1.1.min.js"></script>
<script src="bootstrap-3.0.3/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="editor/kindeditor/themes/default/default.css" />
<script charset="utf-8" src="editor/kindeditor/kindeditor-min.js"></script>
<script charset="utf-8" src="editor/kindeditor/lang/zh_CN.js"></script>
<style type="text/css">
	form {
		margin: 0;
	}
	textarea {
		display: block;
	}
</style>
<script>
var editor;
KindEditor.ready(function(K) {
	editor = K.create('textarea[name="topic.content"]', {
		allowFileManager : true
	});
	K('input[name=getHtml]').click(function(e) {
		alert(editor.html());
	});
	K('input[name=isEmpty]').click(function(e) {
		alert(editor.isEmpty());
	});
	K('input[name=getText]').click(function(e) {
		alert(editor.text());
	});
	K('input[name=selectedHtml]').click(function(e) {
		alert(editor.selectedHtml());
	});
	K('input[name=setHtml]').click(function(e) {
		editor.html('<h3>Hello KindEditor</h3>');
	});
	K('input[name=setText]').click(function(e) {
		editor.text('<h3>Hello KindEditor</h3>');
	});
	K('input[name=insertHtml]').click(function(e) {
		editor.insertHtml('<strong>插入HTML</strong>');
	});
	K('input[name=appendHtml]').click(function(e) {
		editor.appendHtml('<strong>添加HTML</strong>');
	});
	K('input[name=clear]').click(function(e) {
		editor.html('');
	});
});
</script>

</head>
<body>
	<div style="width:1170px;margin:0px auto;height:660px;">
		<div><img alt="" src="css/images/logo.png"> </div>
		<nav class="navbar navbar-default" role="navigation">
			<div class="container-fluid">
			<div class="navbar-header" style="margin-left:20px;">
				<a class="navbar-brand" href="#">首页</a>
			</div>
			<div>
				<ul class="nav navbar-nav">
					<li class="active"><a href="#">个人主页</a></li>
					<li class="dropdown">
						<a href="#" class="dropdown-toggle" data-toggle="dropdown">
							我的邮箱
							<b class="caret"></b>
						</a>
						<ul class="dropdown-menu">
							<li><a href="#">jmeter</a></li>
							<li><a href="#">EJB</a></li>
							<li><a href="#">Jasper Report</a></li>
							<li class="divider"></li>
							<li><a href="#">分离的链接</a></li>
							<li class="divider"></li>
							<li><a href="#">另一个分离的链接</a></li>
						</ul>
					</li>
				</ul>
				</div>
			</div>
			<div class="container-fluid"> 
			<div class="navbar-header">
				<a class="navbar-brand" href="#">发表主题</a>
			</div>
			<form class="navbar-form navbar-left" role="search">
				<div class="form-group">
					<input type="text" class="form-control" placeholder="主题">
				</div>
				<button type="submit" class="btn btn-default">搜索</button>
			</form>
			</div>
			<div class="container-fluid" style="margin-right:20px;">
				<c:if test="${loginUser!=null}">
					<ul class="nav navbar-nav navbar-right">
				      <li><a href="#"><span class="glyphicon glyphicon-user"></span>${loginUser.userName} </a></li>
				      <li><a href="cancel"><span class="glyphicon glyphicon-log-in"></span>注销</a></li>
				    </ul> 
				</c:if>
				<c:if test="${loginUser==null}">
			    <ul class="nav navbar-nav navbar-right">
			      <li><a href="user_register.jsp"><span class="glyphicon glyphicon-user"></span> 注册</a></li>
			      <li><a href="user_login.jsp"><span class="glyphicon glyphicon-log-in"></span> 登录</a></li>
			    </ul>
			     </c:if>
			 </div>
		</nav>
		<div style="clear: left;width:1170px;border:1px solid #DEDEDE;line-height: 35px;background-color: #F5F5F5;font-size: 13px;text-indent: 
		1.5em;margin-top:10px;color:#0C91E0;">
			首页  / 发表主题
		</div>
		
		<form action="saveSubject" method="post" style="margin-left: 20px;margin-top:20px;">
			<label>标题</label> <input type="text" name="topic.title" placeholder="标题" id="title" style="width:300px;height:35px;margin-bottom: 10px;margin-left:10px;"/><br/>
			<label>板块</label> 
			<select id="forumId" name="forumId" style="width:300px;height:30px;margin-bottom: 10px;margin-left:10px;">
				<option value="0">————————选择板块————————</option>
				<c:forEach items="${forums }" var="forum">
					<option value="${forum.id}">${forum.name}</option>
				</c:forEach>
			</select>
			<br/>
			<input type="text" name="userId" value="${loginUser.id}"/>
			<span style="float:left;display:inline-block; margin-right: 15px;"><label>内容</label></span>
			<textarea name="topic.content" style="float:left;width:600px;height:300px;">KindEditor</textarea>
			<p></p>
			<input type="submit" value="发表" id="fabiao_but"/>
		</form>
	</div>
	<div id="footer" style="width:1170px;height:70px; margin:0px auto;background-color: #F5F5F5;text-align: center;border:1px solid #EBEBEB;">
		<p>手机论坛 xda.cn</p>
		<p>Designed Sam Chen</p>
	</div>
</body>
</html>